﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using Wilke.Interactive.Drone.Contracts;
using System.Collections.ObjectModel;
using Microsoft.VisualBasic.Activities;
using System.ComponentModel;

namespace Wilke.Interactive.Drone.Extensions.Activities
{
    public abstract class BaseActivity : CodeActivity
    {
        #region Public Properties

        /// <summary>
        /// The argument that keeps a reference to the object that implements the IDroneCommander interface.
        /// </summary>    
        [Browsable(false)]
        public InArgument<IDroneCommander> DroneCommanderArgument { get; set; }

        /// <summary>
        /// The object that implements the IDroneCommander interface.
        /// </summary>    
        [Browsable(false)]
        protected IDroneCommander DroneCommander { get; set; }

        #endregion

        public BaseActivity()
        {
            DroneCommanderArgument = new InArgument<IDroneCommander> { Expression = new VisualBasicValue<IDroneCommander>("DroneCommander") };
        }

        protected override void Execute(CodeActivityContext context)
        {
            DroneCommander = DroneCommanderArgument.Get(context);
        }
    }
}
